<template>
  <div>
    <div>
      <h4>B幻觉</h4>
      <el-row>
        <el-col :span="6">
          <div>
            <span>频度 </span>
            <el-select v-model="pgForm.b_hallucination_value1" placeholder="请选择" style="width: 50%;">
              <el-option
                v-for="item in options1"
                :key="item.value"
                :label="item.label"
                :value="item.value">
              </el-option>
            </el-select>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="6">
          <div>
            <span>严重程度 </span>
            <el-select v-model="pgForm.b_hallucination_value2" placeholder="请选择" style="width: 50%;">
              <el-option
                v-for="item in options2"
                :key="item.value"
                :label="item.label"
                :value="item.value">
              </el-option>
            </el-select>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="6">
          <div>
            <span>苦恼程度 </span>
            <el-select v-model="pgForm.b_hallucination_value3" placeholder="请选择" style="width: 50%;">
              <el-option
                v-for="item in options3"
                :key="item.value"
                :label="item.label"
                :value="item.value">
              </el-option>
            </el-select>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="6">
          <div>
            <span>得分 </span>
            <el-input v-model="pgForm.b_hallucination_input" placeholder="" style="width: 50%;"></el-input>
            <span> 分</span>
          </div>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script>
export default {
  name: "b_hallucination",
  title: "B幻觉",
  created() {
    if(this.istrans){
      this.pgForm=this.fromdata
    }
  },
  props: {
    fromdata:{},
    istrans:false,
  },
  data() {
    return {
      options1: [{
        value: '1',
        label: '1 偶尔'
      }, {
        value: '2',
        label: '2 经常'
      }, {
        value: '3',
        label: '3 频繁'
      }, {
        value: '4',
        label: '4 非常频繁'
      }],
      options2: [{
        value: '1',
        label: '1 轻度'
      }, {
        value: '2',
        label: '2 中度'
      }, {
        value: '3',
        label: '3 明显'
      }],
      options3: [{
        value: '0',
        label: '0 没有'
      }, {
        value: '1',
        label: '1 轻微'
      }, {
        value: '2',
        label: '2 轻度'
      }, {
        value: '3',
        label: '3 中度'
      }, {
        value: '4',
        label: '4 严重'
      }, {
        value: '5',
        label: '5 很重或极重'
      }],
      pgForm: {
        b_hallucination_value1: '',
        b_hallucination_value2: '',
        b_hallucination_value3: '',
        b_hallucination_input: ''
      }
    }
  },
  computed: {
    sum(){
      return (this.pgForm.b_hallucination_value1.slice(0,1))*1 + (this.pgForm.b_hallucination_value2.slice(0,1))*1 + (this.pgForm.b_hallucination_value3.slice(0,1))*1
    }
  },
  watch: {
    sum(val){
      this.pgForm.b_hallucination_input = val
    }
  }
}
</script>

<style scoped>
.el-row{
  margin: 10px 0;
  padding: 20px 20px;
  background-color: #f9f9f9;
}
</style>
